﻿using System;
using System.Collections.Generic;
using Windows.UI.Xaml.Data;

namespace Unread.App.Converters
{
    public sealed class BackgroundToRandomColorConverter : IValueConverter
    {
        private static readonly Random _random = new Random();
        private static readonly List<string> _colors = new List<string> { "#FF0097", "#A200FF", "#00ABA9", "#8CBF26", "#A05000", "#E671B8", "#F09609", "#1BA1E2", "#E51400", "#339933",
            "#2d89ef", "#eff4ff", "#2b5797",
            "#00a300", "#99b433", "#1e7145",
            "#b91d47", "#ffc40d", 
            "#e3a21a", "#da532c",
            "#9f00a7", "#7e3878",
            "#603cba", 
            "#1d1d1d", "#d5e7ec",
            "#525252", "#2d89ef"
        };

        public object Convert(object value, Type targetType, object parameter, string language)
        {
            return _colors[_random.Next(_colors.Count - 1)];
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            throw new NotImplementedException();
        }
    }
}
